import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('../views/HomeView.vue')
    },
    {
      path: '/dicom-static',
      name: 'dicom-static',
      component: () => import('../views/DicomStaticView.vue')
    },
    {
      path: '/dicom-folder',
      name: 'dicom-folder',
      component: () => import('../views/DicomFolderView.vue')
    },
    {
      path: '/dicom-zip',
      name: 'dicom-zip',
      component: () => import('../views/DicomZipView.vue')
    },
    {
      path: '/nii-loader',
      name: 'nii-loader',
      component: () => import('../views/NiiLoaderView.vue')
    },
    {
      path: '/dicom-nii-combo',
      name: 'dicom-nii-combo',
      component: () => import('../views/DicomNiiComboView.vue')
    },
    {
      path: '/format-validation',
      name: 'format-validation',
      component: () => import('../views/FormatValidationView.vue')
    },
    {
      path: '/dicom-dynamic',
      name: 'dicom-dynamic',
      component: () => import('../views/DicomDynamicView.vue')
    },
    {
      path: '/dicom-3phase',
      name: 'dicom-3phase',
      component: () => import('../views/Dicom3PhaseView.vue')
    },
    {
      path: '/dicom-volume',
      name: 'dicom-volume',
      component: () => import('../views/DicomVolumeView.vue')
    },
    {
      path: '/integrated-viewer',
      name: 'integrated-viewer',
      component: () => import('../views/IntegratedViewerView.vue')
    }
  ]
})

// 添加全局错误处理
router.onError((error) => {
  console.error('路由错误:', error)
})

export default router
